using I2.Loc;

public class MarketWearableInfoPanel : MarketProductInfoPanel
{
	public UILabel armorCount;

	public UILabel armorCountADD;

	public UISprite rareTypeSprite;

	public UILabel rareTypeLabel;

	public override void SetInfo(Product product, bool setUpgrades, bool needComparison = true)
	{
		currentProduct = product;
		base.SetInfo(product, setUpgrades);
		ProductWearable productWearable = (ProductWearable)product;
		ProductWearable productWearable2 = ((!needComparison) ? product : MarketControllerUI.instance.selectedProduct) as ProductWearable;
		if (productWearable2 == productWearable)
		{
			armorCount.text = productWearable.bonusHP.ToString();
			if ((bool)armorCountADD)
			{
				armorCountADD.text = string.Empty;
			}
		}
		else
		{
			armorCount.text = productWearable2.bonusHP.ToString();
			if ((bool)armorCountADD)
			{
				armorCountADD.text = CompareParametrs(productWearable.bonusHP, productWearable2.bonusHP, "F0");
			}
		}
		rareTypeSprite.spriteName = "RareType_" + productWearable.rare;
		rareTypeLabel.text = ScriptLocalization.Get("Market/RareType_" + productWearable.rare);
		SetTitleLocalization();
		SetDescriptionLocalization();
		if (setUpgrades)
		{
			SetUpgrades();
		}
		else
		{
			SelectUpgradeButton();
		}
	}
}
